<!DOCTYPE HTML>
<!--[if IE 9]><html class="ie9"><![endif]-->
<!--[if IE 8]><html class="ie8"><![endif]-->
<!--[if IE 7]><html class="ie7"><![endif]-->
<!--[if IE 6]><html class="ie6"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html><!--<![endif]-->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="applicable-device" content="pc">
    <meta name="baidu-site-verification" content="Qu9OzfSVVJ" />
    <title>避风塘</title>
    <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/static/img/favicon_1.ico">
    <link rel="icon" href="/static/img/favicon_1.ico" size="16x16 32x32">
    <link rel="stylesheet" href="__TMPL__/public/menu/css/restaurant_f2ca72fb.css" />
    <meta name="lx:category" content="waimai">
    <meta name="lx:appnm" content="mtpc">
    <meta name="lx:autopv" content="off"/>
</head>
<body>
<div class="shopping-cart clearfix" data-status="1" data-poiname="" data-poiid="144719130595065265">
    <form method="post" action="/order/shoppingcart" id="shoppingCartForm">
        <div class="title">
            <span class="fl buy-title">购物车</span>
            <span class="fr dishes"><a href="javascript:;" class="clear-cart"><i></i>清空</a></span>
        </div>
        <div class="titles" id="cart">
        </div>
        <div class="total">共<span class="totalnumber">0</span>份，总计￥<span class="bill">0</span></div>
        <div class="footer clearfix">
            <div class="fr">
                <a class="ready-pay borderradius-2" href="{:url('menu/order')}">结算</a>
                <input class="go-pay borderradius-2" type="submit" value="立即下单" />
                <input type="hidden" value="" class="order-data" name="shop_cart" />
            </div>
        </div>
    </form>
</div>
<div class="wrapper">
    <div class="page-wrap">
        <div class="inner-wrap">
            <div class="food-list fl">

                <div class="cate-tab-area">
                    <div class="tab-link">
                        <div class="tab-link-inner clearfix">
                            <a href="{:url('menu/menu')}" class="tab-item  active">单品</a>
                            <a href="{:url('menus/menu')}" class="tab-item  active">套餐</a>
                        </div>
                    </div>
                    <div class="ori-foodtype-nav clearfix">
                        <ul class="clearfix">
                                <li  class="active"  >
                                    <a href="{:url('menus/menu')}" class="type" data-anchor=""                                                                                                      title="">
                                            <span class="name">
                                            </span>
                                    </a>
                                </li>
                        </ul>
                    </div>
                </div>

                <div class="food-nav">
                        <div class="category">
                            <h3 class="title title-2" title="">
                                <span class="tag-na"></span>
                            </h3>
                            <div class="pic-food-cont clearfix">
                                <foreach name="category" item="vo">
                                    <if condition="$vo neq null">
                                        <div class="j-pic-food pic-food  " id="goods">
                                            <div class="avatar">
                                                <img src="__ROOT__/upload/"  class="food-shape scroll-loading" alt="" />
                                            </div>
                                            <div class="np clearfix">
                                                  <span class="name fl" title="">
                                                    {$vo.set_name}
                                                  </span>
                                            </div>
                                            <div class="sale-info clearfix">
                                                <div class="sold-count ct-lightgrey">
                                                </div>

                                            </div>

                                            <div class="labels clearfix" >
                                                <a  class="add fr icon i-addcart j-addcart" >
                                                    <input type="hidden" class="goods_id" value="{$vo.set_id}">
                                                </a></a>
                                                <span id="food85212566-cart-num" class="pic-food-cart-num fr" style="display:none;">0</span>
                                                <div class="price fl">
                                                    <div class="only">原价：&yen;{$vo.set_price}<br/>折后：&yen;{$vo.set_prices}</div>
                                                </div>
                                            </div>
                                        </div>
                                    </if>
                                </foreach>
                            </div>

                        </div>
                </div>
            </div>


            <div class="widgets fr">
            </div><div class="clear"></div>

            <input type="hidden" data-poi-id="144719130595065265" data-pv-flag="1" />

        </div>
    </div>
</div>
</body>
<script src="__TMPL__/public/menu/js/jquery.js"></script>
<script >
    /*
    * 添加商品
    * */
    $('.add').click(function(){
        var id=$(this).find('.goods_id').val();
        var format=$(this).find('.format').val();
        $.post("{:url('menu/cart')}",{id:id,format:format,price:price,name:name},function (date) {
            var data=date.msg;
            var src='';
            $.each(data,function(k,val){
                src += '<tr class="dd">' +
                    '<td class="left">' +
                    val.g_goodsname+'('+val.format+')'+
                    '</td>'+
                    '<td class="right">&yen;'+val.price+'</td>' +
                    '<td class="right "><a class="del"><input type="hidden" class="dels" value="'+k+'"/>删除</a>' +
                    '</td>' +
                    '</tr>';
                $('#cart').html(src);
            })
        },'json')
    });
    /*
    * 清空
    * */
    $('.clear-cart').click(function(){
        $.post("{:url('menu/emptys')}",function (date) {
            $('#cart').children('tr').remove();
        },'json')
    });
    /*
   * 删除
   * */
    $('#cart').on('click','.del',function () {
        var k=$(this).children('input').val();
        $.post("{:url('menu/del')}",{k:k},function(date)
        {
            var data=date.msg.data;
            var src='';
            $.each(data,function(k,val){
                src += '<tr class="dd">' +
                    '<td class="left">' +
                    val.g_goodsname+'('+val.format+')'+
                    '</td>'+
                    '<td class="right">&yen;'+val.price+'</td>' +
                    '<td class="right "><a class="del"><input type="hidden" class="dels" value="'+k+'"/>删除</a>' +
                    '</td>' +
                    '</tr>';
                $('#cart').html(src);
            })
        },'json')

    })
</script>
</html>

